﻿using Newtonsoft.Json;
using System.Collections.Generic;
using XUCore.WeChat.Apis;

namespace XUCore.WeChat.Enterprise.Apis.Member
{
    /// <summary>
    /// 客户详情集合
    /// </summary>
    public class MemberListApiResult : ApiResultBase
    {
        /// <summary>
        ///     外部联系人信息集合
        /// </summary>
        [JsonProperty("external_contact_list")]
        public List<MemberInfoResults> external_contact_list { get; set; }

        /// <summary>
        ///     分页的cursor，当跟进人多于500人时返回
        /// </summary>
        [JsonProperty("next_cursor")]
        public string next_cursor { get; set; }

        /// <summary>
        ///     查询失败的集合
        /// </summary>
        [JsonProperty("fail_info")]
        public FailInfoResult fail_info { get; set; }

        public override bool IsSuccess()
        {
            return true;
        }
    }

    public class MemberInfoResults
    {
        /// <summary>
        ///     外部联系人信息
        /// </summary>
        [JsonProperty("external_contact")]
        public MemberInfoResult external_contact { get; set; }
    }

    public class FailInfoResult
    {
        /// <summary>
        ///     注：若请求中所有userid都无有效互通许可，接口直接报错701008。如果部分userid无有效互通许可，接口返回成功，该字段为无许可的userid列表
        /// </summary>
        [JsonProperty("unlicensed_userid_list")]
        public List<string> unlicensed_userid_list { get; set; }

    }
}
